package operation;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class WriteMessage {
	private String filepath = "resource/info.txt";
	private String date;

	public WriteMessage(StringBuffer dt) throws IOException {
		this.date = dt.toString();
	
	}

	public void write() throws IOException {
		BufferedWriter bw = new BufferedWriter(new FileWriter(filepath, true));
		bw.write(date);
		bw.newLine();
		bw.close();
	}
	
	public void onlywrite() throws IOException {
		BufferedWriter bw = new BufferedWriter(new FileWriter(filepath));
		bw.write(date);
		bw.close();
	}

}
